package com.icss.ah.base.util;

import java.util.ResourceBundle;

public class ResourceLoader {

	private static ResourceLoader instance;

	/**
	 * @param configFile 只需传配置文件的名字即可,无需加后缀
	 * @return
	 */
	public static ResourceLoader getInstance(String configFile) {
		if (instance == null) {
			instance = new ResourceLoader(configFile);
		}
		return instance;
	}

	private ResourceBundle resourceBundle;

	private ResourceLoader(String resourceName) {
		resourceBundle = ResourceBundle.getBundle(resourceName);
	}

	public String getString(String key) {
		return resourceBundle.getString(key);
	}

	public static void main(String[] args) {
		System.out.println(ResourceLoader.getInstance("db").getString("jdbc.url"));
	}
}